<template>
	<view class="container">
		<view class="CDK" @click="copy(CDK)">
			{{CDK}}
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		onMounted,
		onBeforeUnmount
	} from 'vue';
	import {
		url
	}
	from '@/utils/request'
	import {
		setMsgStorage
	} from '@/utils/setMsgStorage.js'
	import {
		onShow,
		onLoad
	} from '@dcloudio/uni-app';
	const CDK = ref('')
	onLoad((option) => {
		CDK.value = option.qrcode
		console.log(option.qrcode)
	})
	//复制
	const copyMessage = (value) => {
		uni.setClipboardData({
			data: value,
			success: function(res) {
				uni.getClipboardData({
					success: function(res) {
						uni.showToast({
							title: "复制成功",
						});
					},
				});
			},
		});
	}
	const copy = (value) => {
			uni.showModal({
				content: value,
				confirmText: '复制内容',
				success: () => {
					uni.setClipboardData({
						data: value,
						success: () => {
							uni.showToast({
								title: '复制成功'
							})
						}
					});
				}
			});
		}
</script>

<style>
	.container {
		display: flex;
		flex-direction: column;
		height: 100vh;
		background-image: url('https://i-blog.csdnimg.cn/direct/db0a27136f094502b6d72e1398d0c8c6.png');
		background-size: cover;
		/* 使背景图片覆盖整个容器 */
		background-position: center;
		/* 居中显示图片 */
		background-repeat: no-repeat;
		/* 防止背景图片重复 */
	}

	.CDK {
		position: absolute;
		font-size: 32px;
		width: 60%;
		color: white;
		margin: 0px 80px 0px;
		text-align: center;
		top: 52%;
		height: 8%;
	}
</style>